package unit2;

import java.util.Scanner;
public class Ex2_7_IfElseDemo {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输月份：");
        int month = in.nextInt(); // 输入月份
        String season;
        if (month == 12 || month == 1 || month == 2)
            season = "冬季";
        else if (month == 3 || month == 4 || month == 5)
            season = "春季";
        else if (month == 6 || month == 7 || month == 8)
            season = "夏季";
        else if (month == 9 || month == 10 || month == 11)
            season = "秋季";
        else
            season = "月份输入错误！";
        System.out.println(month + "月，属于 " + season + "。");
    }
}
